package com.maes.hughes.example.spring;

import com.maes.hughes.example.spring.config.CombateConfigDemo;
import com.maes.hughes.example.spring.config.MyConfig;
import com.maes.hughes.example.spring.service.MyService;
import com.maes.hughes.example.spring.service.MyService2;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 *
 * @author 程序猿DD
 * @version 1.0.0
 * @blog http://blog.didispace.com
 *
 */
@SpringBootApplication
public class Application {

	public static void main(String[] args) {

		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(CombateConfigDemo.class);
		MyService bean = context.getBean(MyService.class);
		bean.out();
		context.close();

//		SpringApplication.run(Application.class, args);

//		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(MyConfig.class);
//		MyService bean1 = context.getBean(MyService.class);
//		MyService bean2 = context.getBean(MyService.class);
//
//
//		MyService2 bean3 = context.getBean(MyService2.class);
//		MyService2 bean4 = context.getBean(MyService2.class);
//		System.out.println(bean1.equals(bean2));
//
//		System.out.println(bean3.equals(bean4));

	}

}
